<script>
$(document).ready(function() {
    $('#list_fee').dataTable( {
        "aLengthMenu": [[10,25,50, 100, -1], [10,25,50,100, "All"]],
		"sPaginationType": "full_numbers",
		"oLanguage": {
            "sLengthMenu": "Menampilkan _MENU_ data",
            "sZeroRecords": "Belum ada data FEE yang tersimpan",
            "sInfo": "",
            "sInfoEmpty": "",
            "sInfoFiltered": "(Hasil filter dari _MAX_ yang didapat)"
        }
    } );
} );
</script>
<?php
$data['cur_parent_menu']='master';
$data['cur_selected_menu']='fee';
$this->load->view('template/menu_view',$data);
?>
<br/><br/><br/><br />
<div class="gridcenter" style="font-family: 'open sans',arial,sans-serif;font-size: 18px;font-weight:bold;color:#666666;">Ubah Fee Supir</div>
<br />
<script>
	$(document).ready(function() {
		$.validator.methods.NotEqual = function(value, element, param) {
		   return value != $(param).val();
		};
		
		$("#form_edit_fee_supir").validate({
			rules: {
				fee: "required",
				asal: {NotEqual: "#tujuan"}
			},
			messages: {
				fee: " *Nilai Fee Supir harus diisi",
				asal : " *Asal tidak boleh sama dengan tujuan"
			}
		});
	});
</script>
<div class="demo_jui datagrid gridcenter">
<form id="form_edit_fee_supir" method="post" action="<?php echo FEE ?>process_edit_fee/<?php echo $id?>">
<table width="700">
	<tr>
		<td width="150">
			Asal
		</td>
		<td>:
			<?php
				for($i=0;$i<count($daftar_asal_tujuan);$i++){
					$opt[$daftar_asal_tujuan[$i]['NamaKota']][$daftar_asal_tujuan[$i]['Nama']] = $daftar_asal_tujuan[$i]['Nama'];
				}
				echo form_dropdown('asal', $opt,$asal,'id="asal"');
			?>
		</td>
	</tr>
	<tr>
		<td>
			Tujuan
		</td>
		<td>:
			<?php
				for($i=0;$i<count($daftar_asal_tujuan);$i++){
					$opt[$daftar_asal_tujuan[$i]['NamaKota']][$daftar_asal_tujuan[$i]['Nama']] = $daftar_asal_tujuan[$i]['Nama'];
				}
				echo form_dropdown('tujuan', $opt,$tujuan,'id="tujuan"');
			?>
		</td>
	</tr>
	<tr>
		<td>
			Fee Supir
		</td>
		<td>
			: <input type="text" name="fee" id="fee" value="<?php echo $fee?>"/>
		</td>
	</tr>
	<tr>
		<td colspan="2">
		&nbsp;
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<input type="submit" value="Ubah"/>
			<input type="button" value="Kembali" onclick="location.href='<?php echo FEE ?>'"/>
		</td>
	</tr>
</table>
</form>
</div>